package com.tuanzi.loan.web.lazy.receipt.statistics;

import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.service.receipt.statistics.ReceiptOrderStatisticsService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.receipt.statistics.ReceiptOrderStatisticsRequest;
import com.tuanzi.loan.vo.response.receipt.statistics.ReceiptOrderStatisticsResponse;

/**
 * @author Ray 2017/09/21
 */
public class ReceiptOrderStatisticsLazyDataModel extends BaseLazyDataModel<ReceiptOrderStatisticsRequest, ReceiptOrderStatisticsResponse> {

	private static final long serialVersionUID = -4670419347550704982L;

	private ReceiptOrderStatisticsService orderStatisticsService = SpringContextHolder.getBean(ReceiptOrderStatisticsService.class);

	public ReceiptOrderStatisticsLazyDataModel(ReceiptOrderStatisticsRequest request) {
		super(request);
	}

	@Override
	protected Page<ReceiptOrderStatisticsResponse> doLoad(PageSearcher<ReceiptOrderStatisticsRequest> pageSearcher) {
		return orderStatisticsService.list(pageSearcher);
	}

}
